package com.jfire.codejson.methodinfo.impl.write;

import java.lang.reflect.Method;
import com.jfire.codejson.util.NameTool;

/**
 * 用于对基础类的处理
 * 
 * @author linbin
 * 
 */
public class ReturnBaseMethodInfo extends AbstractWriteMethodInfo
{
    
    public ReturnBaseMethodInfo(Method method)
    {
        super(method);
        Class<?> returnType = method.getReturnType();
        str = "cache.append(\"\\\"" + NameTool.getNameFromMethod(method) + "\\\":\")";
        if (returnType.equals(char.class))
        {
            str += ".append('\"').append(" + getValue + ").append('\"').append(',');\n";
        }
        else
        {
            str += ".append(" + getValue + ").append(',');\n";
        }
    }
}
